package com.liws.hellofeiginclient.feigin;

import com.liws.hellocommon.entity.Person;
import com.liws.hellofeiginclient.sentinel.ProductClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: liweisheng
 * @Dcscription:
 * @Date: 2021/11/22 9:14
 */
@FeignClient(name ="hello-feigin-service",fallbackFactory = ProductClientFallbackFactory.class)
public interface ProductClient {

    @RequestMapping(value = "feigin/product/getFeiginByName",method = RequestMethod.GET)
    public String getFeiginByName(@RequestParam(value = "name") String name);


    @RequestMapping(value = "feigin/product/postFeiginByObject",method = RequestMethod.POST)
    public List<Person> postFeiginByObject(@RequestBody Person person);
}
